package de.steric.battlemon.rendering;

import org.lwjgl.util.vector.Matrix4f;

import de.steric.MathHelper;
import de.steric.battlemon.GameObject;

public class Camera extends GameObject{
	public float FOV=60f, width=800, height=600, nearPlane=0.1f, farPlane=100f;
	public Matrix4f viewProjection;
	public void setViewProjection()
	{
		Matrix4f mat=MathHelper.getRotation(getRotation());
		mat.translate(getPosition());
		if(mat.invert()==null)
		{
			System.err.println("Could not invert ViewMatrix");
			System.exit(1);
		}
		Matrix4f projection=MathHelper.getProjectionMatrix(FOV, width/height, nearPlane, farPlane);
		Matrix4f.mul(projection, mat, mat);
		
		viewProjection = mat;
	}

}
